<?php
	include "../controller/ConectBanco.php";
    include "../controller/Sessao.php";
	
	if($_SESSION["login"] != "admin"){
		header("location:../view/Principal.php");
	}
	$idModel = $_GET['idModel'];
	
	$queryModel = mysql_query("SELECT * FROM model WHERE idModel = $idModel")or die(mysql_error());
	$arrayModel = mysql_fetch_array($queryModel);
?>	

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 lt8"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7 lt8"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8 lt8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="UTF-8" />
        <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">  -->
        <title>Edicao Model</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <meta name="description" content="Login and Registration Form with HTML5 and CSS3" />
        <meta name="keywords" content="html5, css3, form, switch, animation, :target, pseudo-class" />
        <meta name="author" content="Codrops" />
        <link rel="shortcut icon" href="../favicon.ico"> 
        <link rel="stylesheet" type="text/css" href="../css/demo.css" />
        <link rel="stylesheet" type="text/css" href="../css/style.css" />
		
    </head>
    <body>
        <div class="container">
           <?php
				include "MenuAdmin.php";
				Menu::data();
				Menu::menuAdmin(); 
			?>
            <header>
                <h1>LOCALIZAGORA<span></br>Sistema de rastreamento via satelite </span></h1>
				
            </header>
            <section>				
                <div id="container_demo" >
                    <!-- hidden anchor to stop jump http://www.css3create.com/Astuce-Empecher-le-scroll-avec-l-utilisation-de-target#wrap4  -->
                    <div id="wrapper">
                        <div id="login" class="animate form">
                            <form  action="../controller/Editar.php?idModel=<?php echo $idModel;?>" method="post" autocomplete="on" > 
                                <h1>Edicao Modelo</h1> 
                                <p> 
                                    <label for="modelo" class="modelo"  > Modelo </label>
                                    <input id="modelo" name="modelo" value="<?php echo $arrayModel['modelo'];?>" required="required" type="text" placeholder="GTxxx  TKxxx"/>
                                </p>
                                <p> 
									<label for="aplicacao" class="aplicacao"  > Aplicacao </label>
                                   <input id="aplicacao" name="aplicacao" value="<?php echo $arrayModel['aplicacao'];?>" required="required" type="text" placeholder="veicular,pessoal..."/>
                                </p>
                                 <p> 
									<label for="marca" class="marca"  > Marca </label>
                                   <input id="marca" name="marca" value="<?php echo $arrayModel['brand'];?>" required="required" type="text" placeholder="Xexun..."/>
                                </p>
                                 <p> 
									<label for="padrao" class="padrao"  > Padrao </label>
                                   <input id="padrao" name="padrao" value="<?php echo $arrayModel['padrao'];?>" required="required" type="text" placeholder="GPRMC..."/>
                                </p>
								
								<p>
									<label for="waterproof" class="waterproof"  > Waterproof </label>
									<select name="waterproof" required="required">
										<?php 
												if($arrayModel['waterproof'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>
								<p>
									<label for="escuta" class="escuta"  > Escuta </label>
									<select name="escuta" required="required">
										<<?php 
												if($arrayModel['escuta'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="cutOil" class="cutOil"  > Cut Oil </label>
									<select name="cutOil" required="required">
										<?php 
												if($arrayModel['cortaCombust'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="cutEletric" class="cutEletric"  > Cut Eletric </label>
									<select name="cutEletric" required="required">
										<?php 
												if($arrayModel['cortaEletric'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="sos" class="sos"  > SOS </label>
									<select name="sos" required="required">
										<?php 
												if($arrayModel['sos'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="bateria" class="bateria"  > Bateria </label>
									<select name="bateria" required="required">
										<?php 
												if($arrayModel['bateria'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="sdCard" class="sdCard"  > SD Card </label>
									<select name="sdCard" required="required">
										<?php 
												if($arrayModel['sdCard'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="vibracao" class="vibracao"  > Vibracao </label>
									<select name="vibracao" required="required">
										<?php 
												if($arrayModel['vibracao'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>							
								<p>
									<label for="ft_alarm" class="ft_alarm"  > ft_alarm </label>
									<select name="ft_alarm" required="required">
										<?php 
												if($arrayModel['ft_alarm'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="ft_tracking" class="ft_tracking"  > ft_tracking </label>
									<select name="ft_tracking" required="required">
										<?php 
												if($arrayModel['ft_tracking'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="ft_charge" class="ft_charge"  > ft_charge </label>
									<select name="ft_charge" required="required">
										<?php 
												if($arrayModel['ft_charge'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>
								<p>
									<label for="ft_acc" class="ft_acc"  > ft_acc </label>
									<select name="ft_acc" required="required">
										<?php 
												if($arrayModel['ft_acc'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="ft_voltage" class="ft_voltage"  > ft_voltage </label>
									<select name="ft_voltage" required="required">
										<?php 
												if($arrayModel['ft_voltage'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>	
								<p>
									<label for="ft_gsmsignal" class="ft_gsmsignal"  > ft_gsmsignal </label>
									<select name="ft_gsmsignal" required="required">
										<?php 
												if($arrayModel['ft_gsmsignal'] == 1){
													echo "<option value=\"1\" selected >Possui</option>
    													  <option value=\"0\"  >Nao possui</option> ";
												}else{
													echo "<option value=\"1\"  >Possui</option>
    													  <option value=\"0\" selected >Nao possui</option> ";
												}
										?>
									</select>	
								</p>												
                               <br><br>
                                <p class="button"> 
                                    <input type="submit" value="Salvar" /> 
								</p>
                                
                            </form>
                        </div>

                        
						
                    </div>
                </div>  
            </section>
        </div>
    </body>
</html>

